A moderate cooling flow phase at galaxy formation