Initial refactorings done