refactor as a constructor
Merge pull request #1 from jonathanong/refactor

refactor