some changes in schema, refactor needed