The second version is equally good, a little bit more verbose but probably easier to follow, so please just merge the new version.