Add maze type, refactoring