Code is refactored and simplified.
Merge pull request #39 from e55k4y/dev

Code is refactored and simplified.