Simplified code
Merged