removing redundant structures