ball position refactoring