a bit more functional