refactorings and updates