rewrite the service to make it more readable and maintainable
Merge pull request #47 from vinitkumar/feature/code-cleanup

rewrite the service to make it more readable and maintainable