Refactor collision procedure