Minor cleanup and lifecyle improvements