move god helper method definition to top of script