refactor ui to use modules