filterelements and resolve