Make the encode line function shorter