Code refactored
Conflict fixed