Convert ternary operator to if-else so it's easier to read and add breakpoints