refactoring maze generator (broken commit!)