refactor out assets loading