generalized some stuff