Move common fns to core