clean up and separating UI logic parts