Major refactor nearing completion

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