replace ternary operators by get()