replaced multi-line conditional  with ternary