KoanService Test and refactoring