This line is now overly complex with the multiple ternary operators `? :` and needs to be split up using if else for readability.