Type loading refactor