There's enough code here, that I'd use an "if-else" rather than a ternary. Just for readability