refactoring - use jasmine spies instead of adding extra property only for testing