stopped using lambdas to support lower PHP versions