Refactor google closure