refactored most of UI elements