x/yOffset to func
Some cleanup.