Refactorying core.clj to be able to test implementation