refactor loading types