Update model to use nested objects. Remove unused code.