introduced sinon and did some cleanup