Refactoring to use the new coordinate system