2 ways to get coordinates in code, refactored