Use closures instead of create_function and apply PSR-2