Expand abnormally used ternary operator to if