refactored level editor