Abstract setting uniform variables to a type class