Remove ternary operator and use an if/else