moved logic to behavior