making class more generic