The diff on this file looks horrendous, please view the actual file itself to see what I have done.  I literally added one action (as described in the pull request) and restructured the file in order to make it more orderly and easier to maintain.