refactored messenger component