Complete nested snippet logic + tests