factor out level loading