Collisions bug resolved and some refactor.