moved logic