availability refactor