Use ternary instead of ugly looking if statement