made major changes in code base, bit of refactoring