level refactoring