Refactoring, added exit, start and end level positions