Reorganizing handlers (binary and text) in production code and tests