moved some stuf into core