refactor frontend a little