simplify nested test