refactor success message to a component