Simply if-else block with ternary expression