nested arrow functions, not so sure, but tests pass