Refactoring AgnGeneLocus, replacing redundant functions with macros