core cleanup: introduce core init/destroy functions