Optimized the runIfStatements method in the view module