Refactoring(Part 2)

Refactoring is complete with this commit