Cleanup stuff. Still To do: Use metadata