Refactor/cleanup - move system fns to core