Refactored some of the methods
Merge pull request #2 from karlpa/refactoring

Refactoring of multiple method