Make it testable and write tests