Moving a few functions into core.fs