refactor code
Merge pull request #21 from mikehoren/REFACTOR3

refactor code