Cleaned up code to insert schemas.