Remove some try-catch, remake some checks in lighting code