refactoring the client
#4 refactor frontend into something reusable