Refactoring testing methods