Refactor ui classes