Split core file to make it more editable