adjustments and refactoring