Move layers.json schema to separate file, and refactor