refactor interaction into a module