refactoring improvements