v2.1  Avoiding the use of anonymous functions to support php versions below 5.3