That should work, but it would be great if you could break this up on a few more lines and not use ternary expressions. It's a little too hard to read.