minor refactor
fix PHPCS issue around casting