re-factor - separate gui code from service layer