Improving the abstraction of the FlashMessageComponent.php