Converting from anonymous function to a method

This is to maintain backward compatibility with PHP 5.2