more generalized approach