Move functions out of check.clj