cleaned up _produce_input_message a little bit