Refactor availability checking