Test refactoring (needless code omitted)