Move some code back to the core.