refactoring of the getA functions