replace static department approach with dynamic