Added some code refactoring
Merge pull request #1 from anvk/refactor

Added some code refactoring