Moved collision detection into own class