refactor coordinate problem