OOP clean-up and ui fixes