Refactoring improvements