More refactoring to use Pos instead of x,y