change to explizit creatiion of objects from functions, adapt tests