updates and refactorings