Implemented some design reformulations
Implemented some modularizations in the code