added testability with karma and jasmine.