Added a way to clean up paths of unwanted pieces