DRY up the property reading code by using macro for repeated pattern