Refactor walkthrough embed code generation