Refactor, jasmine tests, angular client