It's probably better this way, with that cast there too, the line would be sooo long using a ternary operator.