Move ui code into own module