improove logics