refactored gap check availability, moved it to theatre.