separated controller and UI