refactor ask code into a module