Refactored so those 2 methods could be made private.