Refactored schema to separate concerns better and fixed #13