refactor level loading