Refactor testing specs