strip usless pieces out of page