be more DRY

handle define and define.async in one if statement