refactor completion module