A bit of refactoring from Rita