Refactor browser code generation.