refining both aflow scripts