refactor and add front end ui stuff