separated ui from logic code.