Added code for generic methods