Clean up and case handlings