Refactor polygon collisions