first step for implementing bykeyOnly=true