move converted message to function