Refactor to reduce duplication
Refactor to reduce duplication

neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode