Cleanup and better initialization