Refactoring code: added Pacman::update method.