need to refactor the UI stuff