Major refactoring of an old game