A little refactoring, almost at a stable point