How do I remove inactive elements?