refactor request reader content length function