Clean up code
Merge pull request #11 from elnn/refactor

Clean up code