proper use of generics