split core.c with free.c