Move "nested" check to helper method so it is centralised and we can
easily change the default