Move more code to core.