using correct variable data types instead of using generic Object type