little refactoring on level loader