Some refactorings;