It may be more readable to not declare the function in the var statement, but instead split the declaration to below.