refactoring gol.js