Some refactoring, and fixed the bug where ghosts would speed up after dieing