function prepareInit(): do some cleanups in the plain-mode