Code refactoring for greater simplicity