updated and test via phpmd and phpcs