A few refactoring