Splitting this core function into smaller functions will make it much easier to test.
Splitting this core function into smaller functions will make it much easier to test.