using ternary operator for remove duplicated maps