refactoring custom message