Improve remove and query mthods