refactor jasmine tests