It seems like every time you call _expectAll, you provide it with new children for the declared children test. Seems like you may as well wrap this behavior up in a newly named function that uses _expectAll (in case you want to still keep that generic). Then, if the only time that _getDeclaredChildrenForTest is called is inside that new wrapper function, you could possibly nix the _getDeclaredChildrenForTest function.