Use a simple foreach here because array_map only supports lambda function as of PHP 5.3.0