Optimized and cleaner access to identifier and attributes

| Q                   | A
| ------------------- | ---
| Bug fix?            | Perf fix
| New feature?        | No
| BC breaks?          | No
| Tests pass?         | Yes
| Scenarios pass?     | Yes
| Checkstyle issues?  | No
| Changelog updated?  | No
| Fixed tickets       | N.A.
| Doc PR              |
`foreach` is better than `array_map` indeed. Here's an interesting article about it: http://willem.stuursma.name/2010/11/22/a-detailed-look-into-array_map-and-foreach/