Better exception handeling
Cleanup.