dima refactor