remove unused imports and refactor consumer and producer to their own classes