Refactored Maze