ui: organize code