Minor refactoring in topic directive (for clarity)