Cleanup nested schema code