small refactor for clarity
added a more reasonable failure message for AE_NOT_FOUND