Removed redundant code
Increased code reusability and maintainability
minor bug fixes