Refactor and add AttributeModel