refactored and expanded schema