refactor frontend into better modules and to use ui router