I'd rather see these functions as local variables instead of globally defined functions.