closes #542 and other refactors on client side