Simple web game - refactoring