refactoring schema