get rid of duplicated conditions