-Simplify ruby embedded conditional logic