Some light inner refactoring.