Moving functionality from core.clj to renderer.clj and entity.clj.