Refactor and mazes generator improvements