Refactor coordinate position calculator