starting to factor out UI stuff