parametric method to extract values