reduce nesting

will make it easier to add more stringent checking to EL6 version