resolve order of function definitions to appease jshint