ClassUI code refactoring