Removed DN parsing code duplication.