small refactor for kernel bvh intersection code