refactor availability predicate
make availability predicate asynchronous