Refactor collision functions from map