refactored core.clj