try to refactor collisions check