Small refactor and cleanup of AppdirectHelper and specs

[#46132685]