Remove unneccessary elements