refactor to use jasmine gem