Rewriting the code to be more easily read and testable.