Bug 1049064: The helper methods needed to be defined before their use