replace private fields x,y  to protected