refactoring of schema.go