dima refactoring