implement missing AAIError and remove redundancies