References in schema and modify queries