How do I use same getter and setter properties and functions for different attributes of a class the