Refactor to simplify
Schema fix