redesigning to be more general