Refactoring of level generation