Ternary operator added Refactoring