impoove logic