Refactor to instance method and update tests accordingly
Merge remote-tracking branch 'origin/master'