- Factor out duplicated code in the process. - The actual code is now smaller and does error checking, and encoding.