modified to get a better phpcs score