refactor into responses and factory