beginning of major rewrite to core data