better to have these functions declared instead of being anonymous, that would improve code readability