Improve refactoring