Moved pointer remapping logic into it's own class.