generating less code for the availability checks