Buillder component extraction

More refactoring to pull out components from the builder so that they can be unit tested more easily. This PR pulls out the string interpolation and tidies up the logging parts a bit