Use ternary operator instead of if/else in strnlower function