Refactored by amsonmal,okdalvi,apnair

E819:Refactoring and Testing