backport rays positioning fix
remove unnecessary fields and conditions