Second round refactoring, after clarifications