Typo fixed (not using vim!)
Deleted huge duplicate chunk, AND refactored code that modifies schema