Refactored code
Merge