glue code and removing of global variables, because memory manager is not initialized