refactoring common message mocking