Basic A=>Z functions refactoring