refactor as a json schema