REFACTORED: extracted the parsing routines in maze_loader.rb