[nim, dj] Refactoring