Refactor to pass phpcs standard