moved txlength default value and setter function to encoder factory