get modified
Refactored the duplicate code