refactored availability checker - tests now pass