Moved a private method to the end of the main closure.