refactoring
added callbacks to handle element select, load availability data