remove unused client side parts and refactor