Made JSHint happy - refactored ternary