Ball with racket collision, refactoring