refactoring, adding levels classs