Moved event binding to a function in prep for later AMD pattern