Refactoring in tests and attachment class.