Some code smells fixed using PhpStorm inspector