You can make this SOOO much tinier by not indenting everything but instead making the body of your renderPass callback a 'continue;' and inverting the logic.