move more code to the core