Change the way module initialisation is done (#3252, #4417)