Revert "Code cleanup"

This reverts commit a7f5c2f4388787045b87b65a3585f7621903ad3f.
Revert "Code clean up"

This reverts commit 2616638db09353f83744df18f35865c0278b0af4.
Revert "Code clean up"

This reverts commit 847980b4227a16be9117227bcdb27ac7f3b2594d.
Cleaned up the code