Refactor IO to handle empty requests