improve logic tests