refactor into classes
Merge pull request #5 from catburston/refactor-into-classes

refactor into classes