Code clean-up

Swapped if/else out for tenary operator and combined variables to
simplify return in remove()