code cleanup and simplification
Merge pull request #20 from manimaul/code-cleanup

code cleanup and simplification