refactor success handler to extract message creation