adding message helper to reduce redundant logic