Using a generic class for multiple types