Refactored away ternary operator - makes it more readable