shortened code by avoiding call to `#flatten`