refactor testing scaffold