various tweaks to improve memory management and core data best practices