diff --git a/src/Abstracts/Email.php b/src/Abstracts/Email.php
index d21f2bb7ec8f7d3bc2af47af6a784e82d8444959..72c8be14d07260df8a6ac6720642853e2bdf6b3a 100644
--- a/src/Abstracts/Email.php
+++ b/src/Abstracts/Email.php
@@ -106,7 +106,7 @@ class Email {
      *
      * @return self
      */
-    public function set_recipients( array $recipients = [] ): self {
+    public function set_recipients( array $recipients ): self {
         $this->recipients = $recipients;
 
         return $this;
@@ -164,7 +164,7 @@ class Email {
     /**
      * @return string
      */
-    public function set_content_type( $type = 'html' ): self {
+    public function set_content_type( $type ): self {
         switch ( $type ) {
             case 'plain':
                 $content_type = 'text/plain';
@@ -200,12 +200,21 @@ class Email {
         return $this->content;
     }
 
+    /**
+     * @param string $name
+     * @param string $value
+     *
+     * @return $this
+     */
     public function set_template_attributes( string $name, string $value ): self {
         $this->template_attributes[ $name ] = $value;
 
         return $this;
     }
 
+    /**
+     * @return array
+     */
     public function get_template_attributes(): array {
         return $this->template_attributes;
     }
diff --git a/src/Helpers/ColorConversion.php b/src/Helpers/ColorConversion.php
index e8242ee402eaa058e124241c4dbda8d4a13337d5..2be755f039299e8c3313f796c41046268502b1ff 100644
--- a/src/Helpers/ColorConversion.php
+++ b/src/Helpers/ColorConversion.php
@@ -11,7 +11,7 @@ class ColorConversion {
      *
      * @return bool  True if a light color.
      */
-    public static function is_hex_light( $color ) {
+    public static function is_hex_light( $color ): bool {
         $hex = str_replace( '#', '', $color );
 
         $c_r = hexdec( substr( $hex, 0, 2 ) );
@@ -31,11 +31,11 @@ class ColorConversion {
     /**
      * Convert RGB to HEX.
      *
-     * @param mixed $color Color.
+     * @param string $color Color.
      *
      * @return array
      */
-    public static function rgb_from_hex( $color ) {
+    public static function rgb_from_hex( string $color ): array {
         $color = str_replace( '#', '', $color );
         // Convert shorthand colors to full format, e.g. "FFF" -> "FFFFFF".
         $color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color );
@@ -52,17 +52,17 @@ class ColorConversion {
     /**
      * Make HEX color darker.
      *
-     * @param mixed $color  Color.
+     * @param string $color  Color.
      * @param int   $factor Darker factor.
      *                      Defaults to 30.
      *
      * @return string
      */
-    public static function hex_darker( $color, $factor = 30 ) {
+    public static function hex_darker( string $color, int $factor = 30 ): string {
         $base  = self::rgb_from_hex( $color );
         $color = '#';
 
-        foreach ( $base as $k => $v ) {
+        foreach ( $base as $v ) {
             $amount      = $v / 100;
             $amount      = self::round( $amount * $factor );
             $new_decimal = $v - $amount;
@@ -81,17 +81,17 @@ class ColorConversion {
     /**
      * Make HEX color lighter.
      *
-     * @param mixed $color  Color.
-     * @param int   $factor Lighter factor.
+     * @param string $color  Color.
+     * @param int    $factor Lighter factor.
      *                      Defaults to 30.
      *
      * @return string
      */
-    public static function hex_lighter( $color, $factor = 30 ) {
+    public static function hex_lighter( string $color, int $factor = 30 ): string {
         $base  = self::rgb_from_hex( $color );
         $color = '#';
 
-        foreach ( $base as $k => $v ) {
+        foreach ( $base as $v ) {
             $amount      = 255 - $v;
             $amount      = $amount / 100;
             $amount      = self::round( $amount * $factor );
diff --git a/src/Helpers/StyleInliner.php b/src/Helpers/StyleInliner.php
deleted file mode 100644
index 9068deeddfad4b16d4da360d196d05c1035b2ae7..0000000000000000000000000000000000000000
--- a/src/Helpers/StyleInliner.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-namespace WPDesk\Library\WPEmail\Helpers;
-
-use Pelago\Emogrifier\CssInliner;
-use Pelago\Emogrifier\HtmlProcessor\CssToAttributeConverter;
-use Pelago\Emogrifier\HtmlProcessor\HtmlPruner;
-
-class StyleInliner {
-
-    public static function inline( string $content, string $styles = '' ): string {
-        if ( class_exists( 'DOMDocument' ) ) {
-            try {
-                $css_inliner  = CssInliner::fromHtml( $content )->inlineCss( $styles );
-                $dom_document = $css_inliner->getDomDocument();
-                HtmlPruner::fromDomDocument( $dom_document )->removeElementsWithDisplayNone();
-                $content = CssToAttributeConverter::fromDomDocument( $dom_document )
-                                                  ->convertCssToVisualAttributes()
-                                                  ->render();
-            } catch ( \Exception $e ) {
-                error_log( $e->getMessage() );
-            }
-        } else {
-            $content = '<style>' . strip_tags( $styles ) . '</style>' . $content;
-        }
-
-        return $content;
-    }
-
-    /**
-     * @return array|string|string[]
-     */
-    protected function replace_placeholders( string $string ): string {
-        if ( empty( $this->placeholders ) ) {
-            return $string;
-        }
-
-        return (string) str_replace( array_keys( $this->placeholders ), array_values( $this->placeholders ), $string );
-    }
-
-}
diff --git a/src/Template.php b/src/Template.php
index c0c66bac330d0f71b66e69ed4a8d03f94b97eab2..545e2bcc2ce1aed07f7e0aaad168f4bc63733006 100644
--- a/src/Template.php
+++ b/src/Template.php
@@ -2,11 +2,20 @@
 
 namespace WPDesk\Library\WPEmail;
 
-use WPDesk\Library\WPEmail\Helpers\StyleInliner;
+use Exception;
+use Pelago\Emogrifier\CssInliner;
+use Pelago\Emogrifier\HtmlProcessor\CssToAttributeConverter;
+use Pelago\Emogrifier\HtmlProcessor\HtmlPruner;
+use Psr\Log\LoggerInterface;
 use WPDesk\View\Renderer\Renderer;
 
 class Template {
 
+    /**
+     * @var LoggerInterface
+     */
+    private $logger;
+
     /**
      * @var Renderer
      */
@@ -17,7 +26,8 @@ class Template {
      */
     private $template_attributes;
 
-    public function __construct( Renderer $renderer, array $template_attributes ) {
+    public function __construct( LoggerInterface $logger, Renderer $renderer, array $template_attributes ) {
+        $this->logger              = $logger;
         $this->renderer            = $renderer;
         $this->template_attributes = wp_parse_args( $template_attributes, $this->get_default_template_attributes() );
     }
@@ -38,7 +48,7 @@ class Template {
     public function css_inline( string $content ): string {
         $styles = $this->renderer->render( 'html/email-styles', $this->template_attributes );
 
-        return StyleInliner::inline( $content, $styles );
+        return $this->convert_css( $content, $styles );
     }
 
     public function get_default_template_attributes(): array {
@@ -53,4 +63,23 @@ class Template {
         ];
     }
 
+    public function convert_css( string $content, string $styles = '' ): string {
+        if ( class_exists( 'DOMDocument' ) ) {
+            try {
+                $css_inliner  = CssInliner::fromHtml( $content )->inlineCss( $styles );
+                $dom_document = $css_inliner->getDomDocument();
+                HtmlPruner::fromDomDocument( $dom_document )->removeElementsWithDisplayNone();
+                $content = CssToAttributeConverter::fromDomDocument( $dom_document )->convertCssToVisualAttributes()->render();
+            } catch ( Exception $e ) {
+                $this->logger->debug( $e->getMessage() );
+
+                return $content;
+            }
+        } else {
+            $content = '<style>' . strip_tags( $styles ) . '</style>' . $content;
+        }
+
+        return $content;
+    }
+
 }
diff --git a/src/WPMailer.php b/src/WPMailer.php
index 9097fc757c20f9c4be16808d4d7d382b49a21ae1..9e7624fd02993e577b7ee04a912878e758da1e77 100644
--- a/src/WPMailer.php
+++ b/src/WPMailer.php
@@ -3,6 +3,8 @@
 namespace WPDesk\Library\WPEmail;
 
 use Exception;
+use Psr\Log\LoggerAwareInterface;
+use Psr\Log\LoggerInterface;
 use WP_Error;
 use WPDesk\Library\WPEmail\Abstracts\Email;
 use WPDesk\Library\WPEmail\Abstracts\Mailer;
@@ -14,12 +16,22 @@ use WPDesk\View\Resolver\DirResolver;
 
 class WPMailer implements Mailer {
 
+    /**
+     * @var LoggerInterface
+     */
+    private $logger;
+
     /**
      * @var Renderer
      */
     private $renderer;
 
-    public function __construct() {
+    public function __construct( LoggerInterface $logger ) {
+       $this->logger = $logger;
+       $this->init_renderer();
+    }
+
+    public function init_renderer() {
         $resolver = new ChainResolver();
         $resolver->appendResolver( new DirResolver( __DIR__ . '/templates' ) );
         $renderer = new SimplePhpRenderer( $resolver );
@@ -53,7 +65,7 @@ class WPMailer implements Mailer {
         );
         add_action( 'wp_mail_failed', [ $this, 'catch_error' ] );
 
-        $email_template = new Template( $this->renderer, $email->get_template_attributes() );
+        $email_template = new Template( $this->logger, $this->get_renderer(), $email->get_template_attributes() );
 
         try {
             $success = wp_mail(
@@ -84,4 +96,5 @@ class WPMailer implements Mailer {
         throw MailerException::with_wp_error( $error );
     }
 
+
 }