Refactoring for Qunit tests