xcor/ycor block refactored