refactor coordinates helper more