avoiding if programming

Taking the code out of if context.