tidy up onInitialized.