refactored code
Merge pull request #1 from GarrethDottin/master

refactored code