Jasmine refactor