refactoring stage 2
finished with qunit tut