break up long ternary if statement