changing implementation to use parameterization