Re-factored the code
Merge pull request #1 from vinothgovindarajan/master

Re-factored the code