I think new pattern here shouldn't be introduced - I mean defining things inside function.