Update internals to use type assertions