refactor asset loading