refactor availability