Refactor/karma tests - refactor some areas of functionality with Celine