Simplify the code by creating a rle_string object