Refactor for better integration with client side.
Update README