ui and level refactoring