Fixed collision grids a little and some refactoring