Move UI into state, handlers