Issue #2245833: Run a Coder review, tidy up and refactor. Should see some performance gains. Overall concept needs to be re-thought.