Move all SCHEMA stuff into a single place (still doesn't work)