try to make the code of set/add/remove more readable with more reuse