functional, considering more robust solution to allow a nesting effect