refactoring sprite collisions