refactored jasmine unit-tests