applying array_map instead of single-line foreach