Cleans up main