refactored wrap with model