Core: Reorder code for cleanup
Core: Cleanup the logging callbacks factory