HPCC-12046 Start refactoring

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>