refactoring progress. add chai, sinon.