implementing generic method get-return-var