Cleanup of coordinate code