Some refactoring ...