After this, the need for some refactoring is clear

As in, it was already clear.  Now it's desperate or something.