refactored code at available dates list